<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>3880：炼辰</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">炼辰</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">炼辰</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                炼辰                </h1>
                <p>时间限制：10s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：256MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><p class="MsoNormal"><span lang="EN-US" style="font-size: 16pt; font-family: 方正瘦金书简体;">Background</span><span style="font-size: 16pt; font-family: 方正瘦金书简体;">：</span></p>
<p class="MsoNormal"><span style="font-size:16.0pt;font-family:方正瘦金书简体;
mso-hansi-font-family:方正瘦金书简体;mso-bidi-font-family:方正瘦金书简体">载着荣耀的流光在星云上启程，不知终落谁手。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:16.0pt;font-family:方正瘦金书简体;
mso-hansi-font-family:方正瘦金书简体;mso-bidi-font-family:方正瘦金书简体">Description</span><span style="font-size:16.0pt;font-family:方正瘦金书简体;mso-hansi-font-family:方正瘦金书简体;
mso-bidi-font-family:方正瘦金书简体">：<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-indent:32.0pt;mso-char-indent-count:2.0"><span style="font-size:16.0pt;font-family:方正瘦金书简体;mso-hansi-font-family:方正瘦金书简体;
mso-bidi-font-family:方正瘦金书简体">星云由<span lang="EN-US">N</span>颗星组成，呈环状分布<span lang="EN-US">(</span>按照顺时针方向标号顺序为<span lang="EN-US">1,2,3,...,N,1,2,3...)</span>，流光可以有两种流动方式：<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:16.0pt;font-family:方正瘦金书简体;
mso-hansi-font-family:方正瘦金书简体;mso-bidi-font-family:方正瘦金书简体">&nbsp;&nbsp;&nbsp; </span><span style="font-size:16.0pt;
font-family:方正瘦金书简体;mso-hansi-font-family:方正瘦金书简体;mso-bidi-font-family:方正瘦金书简体">一、沿顺时针由一颗星滑向它的下一颗星。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:16.0pt;font-family:方正瘦金书简体;
mso-hansi-font-family:方正瘦金书简体;mso-bidi-font-family:方正瘦金书简体">&nbsp;&nbsp;&nbsp; </span><span style="font-size:16.0pt;
font-family:方正瘦金书简体;mso-hansi-font-family:方正瘦金书简体;mso-bidi-font-family:方正瘦金书简体">二、我们定义&ldquo;焱&rdquo;为一种传送机制，即若两个星球之间燃烧着&ldquo;焱&rdquo;，则顺时针序靠后的星球，可以通过此机制传送回顺时针序靠前的那个星球。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-indent:32.0pt;mso-char-indent-count:2.0"><span style="font-size:16.0pt;font-family:方正瘦金书简体;mso-hansi-font-family:方正瘦金书简体;
mso-bidi-font-family:方正瘦金书简体">某一天星云被破坏了，只剩下了最后一抹荣耀流光被两股神秘力量角逐。而破坏带来了两个限制：<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:16.0pt;font-family:方正瘦金书简体;
mso-hansi-font-family:方正瘦金书简体;mso-bidi-font-family:方正瘦金书简体">&nbsp;&nbsp;&nbsp; </span><span style="font-size:16.0pt;
font-family:方正瘦金书简体;mso-hansi-font-family:方正瘦金书简体;mso-bidi-font-family:方正瘦金书简体">一、某颗行星<span lang="EN-US">P</span>被设定为流光禁区（即永远无法被选择为流光的落脚点）。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-indent:32.0pt;mso-char-indent-count:2.0"><span style="font-size:16.0pt;font-family:方正瘦金书简体;mso-hansi-font-family:方正瘦金书简体;
mso-bidi-font-family:方正瘦金书简体">二、一旦一颗星被流光划过，那么就再也不能被经过了。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-indent:32.0pt;mso-char-indent-count:2.0"><span style="font-size:16.0pt;font-family:方正瘦金书简体;mso-hansi-font-family:方正瘦金书简体;
mso-bidi-font-family:方正瘦金书简体">现在两种神秘力量轮流引导流光的流动，先手在第一次操作时为确定流光的起始位置，问谁可以拿到最后一次的掌控权来获得胜利？<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-indent:32.0pt;mso-char-indent-count:2.0"><span style="font-size:16.0pt;font-family:方正瘦金书简体;mso-hansi-font-family:方正瘦金书简体;
mso-bidi-font-family:方正瘦金书简体">另外学者们发现，&ldquo;焱&rdquo;具有特殊的性质：<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-indent:32.0pt;mso-char-indent-count:2.0"><span style="font-size:16.0pt;font-family:方正瘦金书简体;mso-hansi-font-family:方正瘦金书简体;
mso-bidi-font-family:方正瘦金书简体">如果把每个&ldquo;焱&rdquo;视为零点为其两个星球的类似圆弧的轨迹，那么两条轨迹之间不会相交或外切，但是内切和包含以及相离都是合法的。<span lang="EN-US"><o:p></o:p></span></span></p>
<p></p></p><hr/><h3>输入格式</h3><p><p class="MsoNormal" style="text-indent: 32pt;"><span style="font-size: 16pt; font-family: 方正瘦金书简体;">第一行三个整数<span lang="EN-US">n</span>，<span lang="EN-US">m</span>，<span lang="EN-US">p</span>表示星云上<span lang="EN-US">n</span>个点按标号顺时针环形排列，有<span lang="EN-US">m</span>个&ldquo;焱&rdquo;，行星<span lang="EN-US">p</span>为流光禁区。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-indent: 32pt;"><span style="font-size: 16pt; font-family: 方正瘦金书简体;">接下来有<span lang="EN-US">m</span>行，每行两个整数<span lang="EN-US">u</span>，<span lang="EN-US">v</span>，表示<span lang="EN-US">u</span>与<span lang="EN-US">v</span>之间存在一个&ldquo;焱&rdquo;。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal"></p>
<p></p></p><hr/><h3>输出格式</h3><p><div>
<p class="MsoNormal" style="text-indent: 32pt;"><span style="font-size: 16pt; font-family: 方正瘦金书简体;">如果先手胜，输出&ldquo;<span lang="EN-US">dawn</span>&rdquo;，否则输出&ldquo;<span lang="EN-US">galaxy</span>&rdquo;。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal"></p>
</div>
<p></p></p><hr/><h3>样例输入</h3><pre>5 5 3
1 1
1 4
2 3
3 4
4 5</pre><hr/><h3>样例输出</h3><pre>dawn</pre><hr/><h3>提示</h3><p><div>1&lt;=p,u,v&lt;=n&lt;=1,000,000</div>
<div>0&lt;=m&lt;=2,000,000</div>
<p></p></p><hr/><h3>题目来源</h3><p>By YGY</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=3880" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=3880" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>